package chapter;
class Student4{
    private String name;
    private int age;
    public Student4(){ }
    public  Student4 (String n){
        name = n;
    }
    public Student4(String n,int a){
        name = n;
        age = a;
    }
    public void read(){
        System.out.println("我是："+name+",年龄："+age);
    }
}
public class Example07 {
    public static void main (String[] args) {
        Student4 stu1 = new Student4("张飞");
        Student4 stu2 = new Student4("张飞",18);// 实例化Student对象
        stu1.read();
        stu2.read();
    }
}
